﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using SharingCenter.Web.Classes;
using System.Drawing.Imaging;
using System.Drawing;

namespace SharingCenter.Web.Shared
{
    public enum EditorType
    {
        Advanced,
        Simple,
        Comment
    }
    public partial class Editor : System.Web.UI.UserControl
    {
        EditorType editorType;
        public string Content { get {
            return txtEditorBox.Text;  
        } set { txtEditorBox.Text = value; } }
        public Unit Width { get { return txtEditorBox.Width; } set { txtEditorBox.Width = value; } }
        public Unit Height { get { return txtEditorBox.Height; } set { txtEditorBox.Height = value; } }
        public EditorType EditorType { get { return editorType; } set { editorType = value; } }
        public string TextBoxClientID { get { return txtEditorBox.ClientID; } }
        public string TextBoxUniqueID { get { return txtEditorBox.UniqueID; } }
        public string CssClass { get; set; }

        void Page_PreRender(object sender, EventArgs e)
        {
            string css = string.Empty;
            switch (editorType)
            {
                case EditorType.Advanced:
                    css = "advanced-editor";
                    break;
                case EditorType.Simple:
                    css = "simple-editor";
                    break;
                case EditorType.Comment:
                    css = "comment-editor";
                    break;
                default: break;
            }
            txtEditorBox.CssClass = css;
            if (!string.IsNullOrEmpty(CssClass))
            {
                txtEditorBox.CssClass += " " + this.CssClass;
            }
        }

    }
}